<style type="text/css">
	.play_close{background:url(<?php echo base_url("assets/images/icon_play_close.png")?>) no-repeat; padding-left:25px;}
	.play_open{background:url(<?php  echo base_url("assets/images/icon_play_open.png")?>) no-repeat; padding-left:25px;}
</style>
<div class="box_content">
    <div class="title_head">
        <h3><i class="fa fa-video-camera"></i> Video</h3>
    </div>
    <div class="video_clip_wp">
        <div class="panel-group" id="accordion">
        <?php $count = 1;foreach($banners as $banner):?>
          <div class="panel panel-default">
            <div class="panel-heading">
              <h4 class="panel-title">
                <a class="video <?php echo ($count == 1)?"play_open":"play_close"?>"  data-toggle="collapse" data-parent="#accordion" href="#collapse<?php echo $count;?>">
                  <?php echo $banner->name;?>
                </a>
              </h4>
            </div>
            <div id="collapse<?php echo $count;?>" class="panel-collapse collapse <?php if($count++ ==1 )echo 'in'?>">
              <div class="panel-body">
                <div class="embed-responsive embed-responsive-16by9">                                  
                    <?php if (strpos($banner->link, '.mp4') !== false || strpos($banner->link, '.MP4') !== false){?>    
                    <video width="100%" controls>
                      <source src="<?php echo $banner->link;?>#t=0.1" type="video/mp4">
                      Your browser does not support this video.
                    </video>
                    <?php }else {?>
                    <iframe class="embed-responsive-item" src="<?php echo $banner->link;?>"></iframe>
                    <?php }?>
                </div>
              </div>
            </div>
          </div>
        <?php endforeach;?>
        </div>
    </div>
</div>
<script language="javascript">
	$(".video").off("click");
	$(".video").click(function(){
		if($(this).attr("class") == "video play_open"){
			$(this).removeClass("play_open");
			$(this).addClass("play_close");
		}else{
			$(".video").removeClass("play_open");
			$(".video").addClass("play_close");
			$(this).addClass("play_open");
			$(this).removeClass("play_close");
		}
	});
</script>